/**
 * @author：anlzou
 * @Date：Created in10:56 2021/4/19
 * @Github：https://github.com/anlzou
 * @Description：
 */
package com.anlzou.lambdaDemo;

public class Java8Tester {
    final static String salutation = "Hello! ";

    public static void main(String args[]){
        GreetingService greetService1 = message ->
                System.out.println(salutation + message);
        greetService1.sayMessage("Runoob");

        test();
    }

    private static void test(){
        final int num = 1;
        Converter<Integer, String> s = (param) -> System.out.println(String.valueOf(param + num));
        s.convert(2);  // 输出结果为 3
    }

    interface GreetingService {
        void sayMessage(String message);
    }

    public interface Converter<T1, T2> {
        void convert(int i);
    }
}
